# 便用Debian 12作为基础镜像
FROM debian:12

# 设置工作目录
WORKDIR /app

# 更新apt源为国内镜像
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g'  /etc/apt/sources.list.d/debian.sources

#、安装软件包
RUN apt update
RUN apt install -y apt-utils
RUN apt install -y vim curl
RUN apt install -y git ninja-build iasl bzip2 meson
RUN apt install -y g++-mingw-w64 mingw-w64 mingw-w64-tools mingw-w64-x86-64-dev nsis
RUN apt install -y python3 python3-venv python3-sphinx
RUN apt install -y python3-sphinx-rtd-theme

RUN apt install -y pacman-package-manager
RUN echo "# /etc/pacman.conf" > /etc/pacman.conf
RUN echo "[options]" >> /etc/pacman.conf
RUN echo "HoldPkg = pacman" >> /etc/pacman.conf
RUN echo "Architecture = auto" >> /etc/pacman.conf
RUN echo "Color" >> /etc/pacman.conf
RUN echo "CheckSpace" >> /etc/pacman.conf
RUN echo "ParallelDownloads = 5" >> /etc/pacman.conf
RUN echo "SigLevel = Never" >> /etc/pacman.conf
RUN echo "LocalFileSigLevel = Optional" >> /etc/pacman.conf
RUN echo "" >> /etc/pacman.conf
RUN echo "[mingw64]" >> /etc/pacman.conf
RUN echo "Include = /etc/pacman.d/mirrorlist.mingw" >> /etc/pacman.conf
RUN echo "" >> /etc/pacman.conf
#RUN echo "[msys]" >> /etc/pacman.conf
#RUN echo "Include = /etc/pacman.d/mirrorlist.msys" >> /etc/pacman.conf

RUN mkdir -p /etc/pacman.d
RUN echo "# /etc/pacman.d/mirrorlist.mingw" > /etc/pacman.d/mirrorlist.mingw
RUN echo "Server = https://mirrors.cloud.tencent.com/msys2/mingw/\$repo/" >> /etc/pacman.d/mirrorlist.mingw
RUN echo "# /etc/pacman.d/mirrorlist.msys" > /etc/pacman.d/mirrorlist.msys
RUN echo "Server = https://mirrors.cloud.tencent.com/msys2/msys/\$arch/" >> /etc/pacman.d/mirrorlist.msys
